home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Development Platforms / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / Slots.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  11.2 KB  |  261 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Sunday, January 6, 1991 at 11:16 PM
  3.     Slots.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc.    1986-1990
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Slots;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingSlots}
  21. {$SETC UsingSlots := 1}
  22.  
  23. {$I+}
  24. {$SETC SlotsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingTypes}
  27. {$I $$Shell(PInterfaces)Types.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingOSEvents}
  30. {$I $$Shell(PInterfaces)OSEvents.p}
  31. {$ENDC}
  32. {$IFC UNDEFINED UsingOSUtils}
  33. {$I $$Shell(PInterfaces)OSUtils.p}
  34. {$ENDC}
  35. {$IFC UNDEFINED UsingFiles}
  36. {$I $$Shell(PInterfaces)Files.p}
  37. {$ENDC}
  38. {$SETC UsingIncludes := SlotsIncludes}
  39.  
  40. CONST
  41. fCardIsChanged = 1;                                 {Card is Changed field in StatusFlags field of sInfoArray}
  42. fCkForSame = 0;                                     {For SearchSRT. Flag to check for SAME sResource in the table. }
  43. fCkForNext = 1;                                     {For SearchSRT. Flag to check for NEXT sResource in the table. }
  44. fWarmStart = 2;                                     {If this bit is set then warm start else cold start.}
  45.  
  46. stateNil = 0;                                       {State}
  47. stateSDMInit = 1;                                   {:Slot declaration manager Init}
  48. statePRAMInit = 2;                                  {:sPRAM record init}
  49. statePInit = 3;                                     {:Primary init}
  50. stateSInit = 4;                                     {:Secondary init}
  51.  
  52. { flags for spParamData }
  53. fall = 0;                                           { bit 0: set=search enabled/disabled sRsrc's }
  54. foneslot = 1;                                       {       1: set=search sRsrc's in given slot only }
  55. fnext = 2;                                          {       2: set=search for next sRsrc }
  56.  
  57. TYPE
  58. SQElemPtr = ^SlotIntQElement;
  59. SlotIntQElement = RECORD
  60.     sqLink: Ptr;                                    {ptr to next element}
  61.     sqType: INTEGER;                                {queue type ID for validity}
  62.     sqPrio: INTEGER;                                {priority}
  63.     sqAddr: ProcPtr;                                {interrupt service routine}
  64.     sqParm: LONGINT;                                {optional A1 parameter}
  65.     END;
  66.  
  67. SpBlockPtr = ^SpBlock;
  68. SpBlock = PACKED RECORD
  69.     spResult: LONGINT;                              {FUNCTION Result}
  70.     spsPointer: Ptr;                                {structure pointer}
  71.     spSize: LONGINT;                                {size of structure}
  72.     spOffsetData: LONGINT;                          {offset/data field used by sOffsetData}
  73.     spIOFileName: Ptr;                              {ptr to IOFile name for sDisDrvrName}
  74.     spsExecPBlk: Ptr;                               {pointer to sExec parameter block.}
  75.     spParamData: LONGINT;                           {misc parameter data (formerly spStackPtr).}
  76.     spMisc: LONGINT;                                {misc field for SDM.}
  77.     spReserved: LONGINT;                            {reserved for future expansion}
  78.     spIOReserved: INTEGER;                          {Reserved field of Slot Resource Table}
  79.     spRefNum: INTEGER;                              {RefNum}
  80.     spCategory: INTEGER;                            {sType: Category}
  81.     spCType: INTEGER;                               {Type}
  82.     spDrvrSW: INTEGER;                              {DrvrSW}
  83.     spDrvrHW: INTEGER;                              {DrvrHW}
  84.     spTBMask: SignedByte;                           {type bit mask bits 0..3 mask words 0..3}
  85.     spSlot: SignedByte;                             {slot number}
  86.     spID: SignedByte;                               {structure ID}
  87.     spExtDev: SignedByte;                           {ID of the external device}
  88.     spHwDev: SignedByte;                            {Id of the hardware device.}
  89.     spByteLanes: SignedByte;                        {bytelanes from card ROM format block}
  90.     spFlags: SignedByte;                            {standard flags}
  91.     spKey: SignedByte;                              {Internal use only}
  92.     END;
  93.  
  94. SInfoRecPtr = ^SInfoRecord;
  95. SInfoRecord = PACKED RECORD
  96.     siDirPtr: Ptr;                                  {Pointer to directory}
  97.     siInitStatusA: INTEGER;                         {initialization E}
  98.     siInitStatusV: INTEGER;                         {status returned by vendor init code}
  99.     siState: SignedByte;                            {initialization state}
  100.     siCPUByteLanes: SignedByte;                     {0=[d0..d7] 1=[d8..d15]}
  101.     siTopOfROM: SignedByte;                         {Top of ROM= $FssFFFFx: x is TopOfROM}
  102.     siStatusFlags: SignedByte;                      {bit 0 - card is changed}
  103.     siTOConst: INTEGER;                             {Time Out C for BusErr}
  104.     siReserved: PACKED ARRAY [0..1] OF SignedByte;  {reserved}
  105.     siROMAddr: Ptr;                                 { addr of top of ROM }
  106.     siSlot: CHAR;                                   { slot number }
  107.     siPadding: PACKED ARRAY [0..2] OF SignedByte;   { reserved }
  108.     END;
  109.  
  110. SDMRecord = PACKED RECORD
  111.     sdBEVSave: ProcPtr;                             {Save old BusErr vector}
  112.     sdBusErrProc: ProcPtr;                          {Go here to determine if it is a BusErr}
  113.     sdErrorEntry: ProcPtr;                          {Go here if BusErrProc finds real BusErr}
  114.     sdReserved: LONGINT;                            {Reserved}
  115.     END;
  116.  
  117. FHeaderRecPtr = ^FHeaderRec;
  118. FHeaderRec = PACKED RECORD
  119.     fhDirOffset: LONGINT;                           {offset to directory}
  120.     fhLength: LONGINT;                              {length of ROM}
  121.     fhCRC: LONGINT;                                 {CRC}
  122.     fhROMRev: SignedByte;                           {revision of ROM}
  123.     fhFormat: SignedByte;                           {format - 2}
  124.     fhTstPat: LONGINT;                              {test pattern}
  125.     fhReserved: SignedByte;                         {reserved}
  126.     fhByteLanes: SignedByte;                        {ByteLanes}
  127.     END;
  128.  
  129. SEBlock = PACKED RECORD
  130.     seSlot: SignedByte;                             {Slot number.}
  131.     sesRsrcId: SignedByte;                          {sResource Id.}
  132.     seStatus: INTEGER;                              {Status of code executed by sExec.}
  133.     seFlags: SignedByte;                            {Flags}
  134.     seFiller0: SignedByte;                          {Filler, must be SignedByte to align on odd boundry}
  135.     seFiller1: SignedByte;                          {Filler}
  136.     seFiller2: SignedByte;                          {Filler}
  137.     seResult: LONGINT;                              {Result of sLoad.}
  138.     seIOFileName: LONGINT;                          {Pointer to IOFile name.}
  139.     seDevice: SignedByte;                           {Which device to read from.}
  140.     sePartition: SignedByte;                        {The partition.}
  141.     seOSType: SignedByte;                           {Type of OS.}
  142.     seReserved: SignedByte;                         {Reserved field.}
  143.     seRefNum: SignedByte;                           {RefNum of the driver.}
  144.     seNumDevices: SignedByte;                       { Number of devices to load.}
  145.     seBootState: SignedByte;                        {State of StartBoot code.}
  146.     END;
  147.  
  148.  
  149.  
  150. {  Principle  }
  151. FUNCTION SReadByte(spBlkPtr: SpBlockPtr): OSErr;
  152.     INLINE $205F,$7000,$A06E,$3E80;
  153. FUNCTION SReadWord(spBlkPtr: SpBlockPtr): OSErr;
  154.     INLINE $205F,$7001,$A06E,$3E80;
  155. FUNCTION SReadLong(spBlkPtr: SpBlockPtr): OSErr;
  156.     INLINE $205F,$7002,$A06E,$3E80;
  157. FUNCTION SGetCString(spBlkPtr: SpBlockPtr): OSErr;
  158.     INLINE $205F,$7003,$A06E,$3E80;
  159. FUNCTION SGetBlock(spBlkPtr: SpBlockPtr): OSErr;
  160.     INLINE $205F,$7005,$A06E,$3E80;
  161. FUNCTION SFindStruct(spBlkPtr: SpBlockPtr): OSErr;
  162.     INLINE $205F,$7006,$A06E,$3E80;
  163. FUNCTION SReadStruct(spBlkPtr: SpBlockPtr): OSErr;
  164.     INLINE $205F,$7007,$A06E,$3E80;
  165.  
  166.  
  167. {  Special  }
  168. FUNCTION SReadInfo(spBlkPtr: SpBlockPtr): OSErr;
  169.     INLINE $205F,$7010,$A06E,$3E80;
  170. FUNCTION SReadPRAMRec(spBlkPtr: SpBlockPtr): OSErr;
  171.     INLINE $205F,$7011,$A06E,$3E80;
  172. FUNCTION SPutPRAMRec(spBlkPtr: SpBlockPtr): OSErr;
  173.     INLINE $205F,$7012,$A06E,$3E80;
  174. FUNCTION SReadFHeader(spBlkPtr: SpBlockPtr): OSErr;
  175.     INLINE $205F,$7013,$A06E,$3E80;
  176. FUNCTION SNextSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  177.     INLINE $205F,$7014,$A06E,$3E80;
  178. FUNCTION SNextTypeSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  179.     INLINE $205F,$7015,$A06E,$3E80;
  180. FUNCTION SRsrcInfo(spBlkPtr: SpBlockPtr): OSErr;
  181.     INLINE $205F,$7016,$A06E,$3E80;
  182. FUNCTION SCkCardStat(spBlkPtr: SpBlockPtr): OSErr;
  183.     INLINE $205F,$7018,$A06E,$3E80;
  184. FUNCTION SReadDrvrName(spBlkPtr: SpBlockPtr): OSErr;
  185.     INLINE $205F,$7019,$A06E,$3E80;
  186. FUNCTION SFindDevBase(spBlkPtr: SpBlockPtr): OSErr;
  187.     INLINE $205F,$701B,$A06E,$3E80;
  188. FUNCTION SFindBigDevBase(spBlkPtr: SpBlockPtr): OSErr;
  189.     INLINE $205F,$701C,$A06E,$3E80;
  190.  
  191.  
  192. {  Advanced  }
  193. FUNCTION InitSDeclMgr(spBlkPtr: SpBlockPtr): OSErr;
  194.     INLINE $205F,$7020,$A06E,$3E80;
  195. FUNCTION SPrimaryInit(spBlkPtr: SpBlockPtr): OSErr;
  196.     INLINE $205F,$7021,$A06E,$3E80;
  197. FUNCTION SCardChanged(spBlkPtr: SpBlockPtr): OSErr;
  198.     INLINE $205F,$7022,$A06E,$3E80;
  199. FUNCTION SExec(spBlkPtr: SpBlockPtr): OSErr;
  200.     INLINE $205F,$7023,$A06E,$3E80;
  201. FUNCTION SOffsetData(spBlkPtr: SpBlockPtr): OSErr;
  202.     INLINE $205F,$7024,$A06E,$3E80;
  203. FUNCTION SInitPRAMRecs(spBlkPtr: SpBlockPtr): OSErr;
  204.     INLINE $205F,$7025,$A06E,$3E80;
  205. FUNCTION SReadPBSize(spBlkPtr: SpBlockPtr): OSErr;
  206.     INLINE $205F,$7026,$A06E,$3E80;
  207. FUNCTION SCalcStep(spBlkPtr: SpBlockPtr): OSErr;
  208.     INLINE $205F,$7028,$A06E,$3E80;
  209. FUNCTION SInitSRsrcTable(spBlkPtr: SpBlockPtr): OSErr;
  210.     INLINE $205F,$7029,$A06E,$3E80;
  211. FUNCTION SSearchSRT(spBlkPtr: SpBlockPtr): OSErr;
  212.     INLINE $205F,$702A,$A06E,$3E80;
  213. FUNCTION SUpdateSRT(spBlkPtr: SpBlockPtr): OSErr;
  214.     INLINE $205F,$702B,$A06E,$3E80;
  215. FUNCTION SCalcSPointer(spBlkPtr: SpBlockPtr): OSErr;
  216.     INLINE $205F,$702C,$A06E,$3E80;
  217. FUNCTION SGetDriver(spBlkPtr: SpBlockPtr): OSErr;
  218.     INLINE $205F,$702D,$A06E,$3E80;
  219. FUNCTION SPtrToSlot(spBlkPtr: SpBlockPtr): OSErr;
  220.     INLINE $205F,$702E,$A06E,$3E80;
  221. FUNCTION SFindSInfoRecPtr(spBlkPtr: SpBlockPtr): OSErr;
  222.     INLINE $205F,$702F,$A06E,$3E80;
  223. FUNCTION SFindSRsrcPtr(spBlkPtr: SpBlockPtr): OSErr;
  224.     INLINE $205F,$7030,$A06E,$3E80;
  225. FUNCTION SDeleteSRTRec(spBlkPtr: SpBlockPtr): OSErr;
  226.     INLINE $205F,$7031,$A06E,$3E80;
  227.  
  228. FUNCTION OpenSlot(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr;
  229. FUNCTION OpenSlotSync(paramBlock: ParmBlkPtr): OSErr;
  230.     INLINE $205F,$A200,$3E80;
  231. FUNCTION OpenSlotAsync(paramBlock: ParmBlkPtr): OSErr;
  232.     INLINE $205F,$A600,$3E80;
  233.  
  234.  
  235. {  Device Manager Slot Support  }
  236. FUNCTION SIntInstall(sIntQElemPtr: SQElemPtr;theSlot: INTEGER): OSErr;
  237.     INLINE $301F,$205F,$A075,$3E80;
  238. FUNCTION SIntRemove(sIntQElemPtr: SQElemPtr;theSlot: INTEGER): OSErr;
  239.     INLINE $301F,$205F,$A076,$3E80;
  240.  
  241. FUNCTION SVersion(spBlkPtr: SpBlockPtr): OSErr;
  242.     INLINE $205F,$7008,$A06E,$3E80;
  243. FUNCTION SetSRsrcState(spBlkPtr: SpBlockPtr): OSErr;
  244.     INLINE $205F,$7009,$A06E,$3E80;
  245. FUNCTION InsertSRTRec(spBlkPtr: SpBlockPtr): OSErr;
  246.     INLINE $205F,$700A,$A06E,$3E80;
  247. FUNCTION SGetSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  248.     INLINE $205F,$700B,$A06E,$3E80;
  249. FUNCTION SGetTypeSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  250.     INLINE $205F,$700C,$A06E,$3E80;
  251. FUNCTION SGetSRsrcPtr(spBlkPtr: SpBlockPtr): OSErr;
  252.     INLINE $205F,$701D,$A06E,$3E80;
  253.  
  254.  
  255. {$ENDC}    { UsingSlots }
  256.  
  257. {$IFC NOT UsingIncludes}
  258.     END.
  259. {$ENDC}
  260.  
  261.